Conditions | 2 |
Total Lines | 12 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { Injectable } from '@nestjs/common'; |
||
16 | |||
17 | async getRole(role: string, paramsFilter?: IParamsFilter): Promise<IRoleRbac> { |
||
18 | const storage = await this.storageRbacService.getStorage(); |
||
19 | if (!storage.roles || !storage.roles.includes(role)) { |
||
20 | throw new RbacExceptions('There is no exist a role.'); |
||
21 | } |
||
22 | |||
23 | return new RoleRbac( |
||
24 | role, |
||
25 | await this.storageRbacService.getGrant(role), |
||
26 | await this.storageRbacService.getFilters(), |
||
27 | paramsFilter, |
||
28 | ); |
||
31 |